import axios from './api' // 倒入 api
import config from './config.js' // 倒入默认配置
export const BASEURL = config.baseURL

/* 将所有接口统一起来便于维护
 * 如果项目很大可以将 url 独立成文件，接口分成不同的模块
 */

// 报告-口腔报告-获取列表
export const GETREPORTSEARCH = (params) => {
  return axios({
    url: '/report/search',
    method: 'GET',
    params,
  })
}

// 报告-口腔报告-新增报告
export const ADDREPORTINFO = (params) => {
  return axios({
    url: '/report/add',
    method: 'POST',
    data: params,
  })
}
// 报告-口腔报告-编辑报告
export const EDITREPORTINFO = (params) => {
  return axios({
    url: '/report/edit',
    method: 'POST',
    data: params,
  })
}
// 报告-口腔报告-获取报告详情
export const GETREPORTINFO = (params) => {
  return axios({
    url: '/report/info',
    method: 'GET',
    params,
  })
}
// 报告-口腔报告-删除报告
export const DELETEREPORTINFO = (params) => {
  return axios({
    url: '/report/delete',
    method: 'GET',
    params,
  })
}
// 报告-口腔报告-导出报告
export const GETREPORTEXPORT = BASEURL + 'report/export'

// 报告-口腔问题-获取口腔问题列表
export const GETORALCAVITYSEARCH = (params) => {
  return axios({
    url: '/oralcavity/search',
    method: 'GET',
    params,
  })
}
// 报告-口腔问题-新增口腔问题
export const ADDORALCAVITYINFO = (params) => {
  return axios({
    url: '/oralcavity/add',
    method: 'POST',
    data: params,
  })
}
// 报告-口腔问题-编辑口腔问题
export const EDITORALCAVITYINFO = (params) => {
  return axios({
    url: '/oralcavity/edit',
    method: 'POST',
    data: params,
  })
}
// 报告-口腔问题-获取口腔问题详情
export const GETORALCAVITYINFO = (params) => {
  return axios({
    url: '/oralcavity/info',
    method: 'GET',
    params,
  })
}
// 报告-口腔问题-删除口腔问题
export const DELETEORALCAVITYINFO = (params) => {
  return axios({
    url: '/oralcavity/delete',
    method: 'GET',
    params,
  })
}
// 报告-口腔问题-导出报告
export const GETORALCAVITYEXPORT = BASEURL + 'oralcavity/export'

// 报告-治疗方案-获取列表
export const GETTREATMENTSEARCH = (params) => {
  return axios({
    url: '/treatment/search',
    method: 'GET',
    params,
  })
}
// 报告-治疗方案-新增治疗方案
export const ADDTREATMENTINFO = (params) => {
  return axios({
    url: '/treatment/add',
    method: 'POST',
    data: params,
  })
}
// 报告-治疗方案-编辑治疗方案
export const EDITTREATMENTINFO = (params) => {
  return axios({
    url: '/treatment/edit',
    method: 'POST',
    data: params,
  })
}

// 报告-治疗方案-获取治疗方案详情
export const GETTREATMENTINFO = (params) => {
  return axios({
    url: '/treatment/info',
    method: 'GET',
    params,
  })
}

// 报告-治疗方案-删除治疗方案
export const DELETETREATMENTINFO = (params) => {
  return axios({
    url: '/treatment/delete',
    method: 'GET',
    params,
  })
}

// 报告-治疗方案-获取所有的治疗方案
export const GETTREATMENTOPTIONS = (params) => {
  return axios({
    url: '/treatment/options',
    method: 'GET',
    params,
  })
}

// 报告-口腔问题-获取所有的口腔问题
export const GETORALCAVITYOPTIONS = (params) => {
    return axios({
      url: '/oralcavity/options',
      method: 'GET',
      params,
    })
  }
